<?php
/*
 * @author eBIZ Team <dev@jungo.com.cn>
 * @copyright  Copyright (c) , ShenZhen JunGO Technology Co., Ltd. All rights reserved.
 * @license  Commercial authorization, unauthorized use and modification are prohibited
 * @url www.jungo.com.cn
 */

namespace ckeeper\services;


use ckeeper\entity\RoleEntity;

interface RoleService
{

    const STATUS_ENABLE = 'enable';
    const STATUS_DISABLE = 'disable';

    /**
     * @param int[] $ids
     * @return string[]
     */
    public function getRightsByIds(array $ids): array;


    /**
     * 添加角色
     * @param RoleEntity $roleEntity
     * @return int|bool
     */
    public function addRole(RoleEntity $roleEntity):int|bool;


    /**
     * 获取所有角色
     * @param string|null $keyword 关键字搜索
     * @return RoleEntity[]
     */
    public function searchRole(string $keyword = null): array;


    /**
     * 修改角色数据(指定修改字段)
     * @param int $id
     * @param string $key
     * @param string $value
     * @return bool
     */
    public function updateRoleData(int $id,string $key,string $value): bool;


    /**
     * 修改角色数据
     * @param RoleEntity $roleEntity
     * @return mixed
     */
    public function updateRole(RoleEntity $roleEntity);


    /**
     * 通过ID获取角色
     * @param int $id
     * @return RoleEntity
     */
    public function getRoleById(int $id);


    /**
     * 通过Id列表删除角色
     * @param array $ids
     * @return mixed
     */
    public function deleteRoleByIds(array $ids);

}
